/**
 * AI应用生成器 - 统一样式主题
 * 基于租户工作台现有设计系统
 */

/* ==================== 全局变量 ==================== */
:root {
    /* 主题色 - 继承自租户工作台 */
    --primary-color: #5272EB;
    --primary-hover: #6376E4;
    --primary-active: #4266D9;
    --secondary-color: #3BB19C;
    --accent-color: #2F8CFF;
    --danger-color: #FF5918;
    
    /* 状态色 */
    --success-color: #00BB9A;
    --warning-color: #EF553B;
    --info-color: #19A4E1;
    
    /* 中性色 */
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-tertiary: #999999;
    --text-placeholder: #CCCCCC;
    --text-white: #FFFFFF;
    
    /* 背景色 */
    --bg-primary: #FFFFFF;
    --bg-secondary: #F5F5F5;
    --bg-tertiary: #F0F0F0;
    --bg-hover: #E4E4E4;
    --bg-active: #D2D2D2;
    
    /* 边框色 */
    --border-light: #F2F2F2;
    --border-normal: #E4E4E4;
    --border-dark: #D7D7D7;
    
    /* 阴影 */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    
    /* 圆角 */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    
    /* 间距 */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    
    /* 字体 */
    --font-family: '微软雅黑', 'Microsoft YaHei', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', sans-serif;
    --font-size-xs: 12px;
    --font-size-sm: 13px;
    --font-size-md: 14px;
    --font-size-lg: 16px;
    --font-size-xl: 18px;
    --font-size-2xl: 24px;
    
    /* 动画 */
    --transition-fast: 0.15s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* ==================== 全局重置 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-md);
    color: var(--text-primary);
    background: var(--bg-secondary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-hover);
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    outline: none;
    background: none;
    transition: all var(--transition-fast);
}

input, textarea {
    font-family: inherit;
    border: none;
    outline: none;
}

/* ==================== 容器布局 ==================== */
#app-container {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: row;
    background: var(--bg-secondary);
}

.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ==================== 侧边栏 ==================== */
.sidebar {
    width: 200px;
    height: 100vh;
    background: #FFFFFF;
    border-right: 1px solid var(--border-normal);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 200;
}

.sidebar-header {
    padding: var(--spacing-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    border-bottom: 1px solid var(--border-light);
    background: #FAFAFA;
}

.logo-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: var(--radius-md);
    color: white;
    font-size: 16px;
}

.sidebar-title {
    font-size: var(--font-size-md);
    font-weight: 600;
    color: var(--text-primary);
}

.sidebar-nav {
    flex: 1;
    padding: var(--spacing-sm) 0;
}

.nav-section {
    margin-bottom: var(--spacing-xs);
}

.nav-parent {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: 10px var(--spacing-md);
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.nav-parent:hover {
    background: var(--bg-secondary);
}

.nav-parent i {
    font-size: 10px;
    color: var(--text-tertiary);
    transition: transform var(--transition-fast);
}

.nav-section.collapsed .nav-parent i {
    transform: rotate(-90deg);
}

.nav-section.collapsed .nav-children {
    display: none;
}

.nav-children {
    padding-left: 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: 8px var(--spacing-md) 8px 32px;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--transition-fast);
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.nav-item.active {
    background: rgba(82, 114, 235, 0.08);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
    font-weight: 500;
}

.nav-item i {
    font-size: 12px;
    width: 16px;
    text-align: center;
}

/* ==================== 顶部导航栏 ==================== */
.app-header {
    height: 60px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-normal);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--spacing-lg);
    box-shadow: var(--shadow-sm);
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
}

.back-btn {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: var(--font-size-md);
    transition: all var(--transition-fast);
}

.back-btn:hover {
    background: var(--bg-secondary);
    color: var(--primary-color);
}

.page-title {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--text-primary);
}

.page-title i {
    color: var(--primary-color);
}

.header-right {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.connection-status {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.status-connected {
    background: var(--success-color);
}

.status-connecting {
    background: var(--warning-color);
}

.status-disconnected {
    background: var(--text-placeholder);
    animation: none;
}

.status-error {
    background: var(--danger-color);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.status-text {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

/* ==================== 按钮样式 ==================== */
.btn-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    background: transparent;
}

.btn-icon:hover {
    background: var(--bg-secondary);
    color: var(--primary-color);
}

.btn-sm {
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.btn-sm:hover {
    background: var(--bg-hover);
}

.btn-primary {
    background: var(--primary-color);
    color: var(--text-white);
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--bg-hover);
}

.btn-send {
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: var(--radius-md);
    background: var(--primary-color);
    color: var(--text-white);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: var(--font-size-md);
    font-weight: 500;
}

.btn-send:not(:disabled):hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-send:disabled {
    background: var(--bg-tertiary);
    color: var(--text-placeholder);
    cursor: not-allowed;
}

/* ==================== 主内容区 ==================== */
.main-content {
    flex: 1;
    display: flex;
    gap: 0;
    overflow: hidden;
}

/* ==================== 左侧对话面板 ==================== */
.chat-panel {
    width: 45%;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    border-right: 1px solid var(--border-normal);
}

.panel-header {
    height: 56px;
    padding: 0 var(--spacing-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-light);
}

.panel-header h2 {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.panel-header h2 i {
    color: var(--primary-color);
}

.panel-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

/* 对话消息区 */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--border-dark);
    border-radius: 3px;
}

/* 欢迎消息 */
.welcome-message {
    text-align: center;
    padding: var(--spacing-xl) var(--spacing-lg);
}

.welcome-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--spacing-lg);
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: var(--text-white);
}

.welcome-message h3 {
    font-size: var(--font-size-xl);
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.welcome-message p {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-lg);
}

.example-prompts {
    margin-top: var(--spacing-lg);
    text-align: left;
}

.example-title {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
}

.example-btn {
    display: block;
    width: 100%;
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
    background: var(--bg-secondary);
    border: 1px solid var(--border-normal);
    border-radius: var(--radius-md);
    text-align: left;
    color: var(--text-primary);
    font-size: var(--font-size-sm);
    transition: all var(--transition-fast);
}

.example-btn:hover {
    background: var(--bg-primary);
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateX(4px);
}

/* 消息气泡 */
.message {
    display: flex;
    gap: var(--spacing-md);
    animation: messageIn 0.3s ease;
}

@keyframes messageIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: var(--font-size-lg);
}

.user-message .message-avatar {
    background: linear-gradient(135deg, var(--secondary-color), #63D1C4);
    color: var(--text-white);
}

.assistant-message .message-avatar {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: var(--text-white);
}

.message-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.message-text {
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    word-wrap: break-word;
}

.user-message .message-text {
    background: var(--primary-color);
    color: var(--text-white);
}

.message-time {
    font-size: var(--font-size-xs);
    color: var(--text-tertiary);
    padding-left: var(--spacing-sm);
}

.system-message {
    justify-content: center;
}

.system-message .message-content {
    max-width: 80%;
    margin: 0 auto;
}

.system-message .message-text {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    text-align: center;
    font-size: var(--font-size-sm);
    padding: var(--spacing-sm) var(--spacing-md);
}

/* 加载动画 */
.loading .message-text {
    padding: var(--spacing-md);
}

.typing-indicator {
    display: flex;
    gap: 4px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-tertiary);
    animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* 流式输出光标 */
.streaming .message-text::after {
    content: '▋';
    color: var(--primary-color);
    animation: blink 1s infinite;
    margin-left: 2px;
}

@keyframes blink {
    0%, 50% {
        opacity: 1;
    }
    51%, 100% {
        opacity: 0;
    }
}

/* 流式输出进度指示 */
.streaming-indicator {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    margin-left: var(--spacing-sm);
    color: var(--primary-color);
    font-size: var(--font-size-xs);
    animation: fadeInOut 1.5s infinite;
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* 代码块样式 */
.code-block {
    margin: var(--spacing-sm) 0;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #282c34;
}

.code-lang {
    padding: var(--spacing-xs) var(--spacing-md);
    background: rgba(0, 0, 0, 0.3);
    color: #abb2bf;
    font-size: var(--font-size-xs);
    text-transform: uppercase;
}

.code-block pre {
    margin: 0;
    padding: var(--spacing-md);
    overflow-x: auto;
}

.code-block code {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: var(--font-size-sm);
    color: #abb2bf;
}

.inline-code {
    padding: 2px 6px;
    background: rgba(82, 114, 235, 0.1);
    border-radius: var(--radius-sm);
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9em;
    color: var(--primary-color);
}

/* 输入框区域 */
.chat-input-container {
    padding: var(--spacing-lg);
    border-top: 1px solid var(--border-light);
    background: var(--bg-primary);
}

.input-wrapper {
    display: flex;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border-normal);
    border-radius: var(--radius-lg);
    transition: all var(--transition-fast);
}

.input-wrapper:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(82, 114, 235, 0.1);
}

#messageInput {
    flex: 1;
    background: transparent;
    resize: none;
    max-height: 200px;
    overflow-y: auto;
    font-size: var(--font-size-md);
    color: var(--text-primary);
}

#messageInput::placeholder {
    color: var(--text-placeholder);
}

.input-actions {
    display: flex;
    align-items: flex-end;
    gap: var(--spacing-sm);
}

.btn-attach {
    color: var(--text-tertiary);
}

.btn-attach:hover {
    color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.05);
}

.input-hint {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-sm);
    padding-left: var(--spacing-md);
    font-size: var(--font-size-xs);
    color: var(--text-tertiary);
}

/* ==================== 分隔条 ==================== */
.resizer {
    width: 10px;
    background: var(--bg-secondary);
    cursor: ew-resize;
    position: relative;
    transition: background var(--transition-fast);
}

.resizer:hover {
    background: var(--border-normal);
}

.resizer::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 2px;
    height: 40px;
    background: var(--border-dark);
    border-radius: 1px;
}

/* ==================== 右侧预览面板 ==================== */
.preview-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
}

.view-mode-switcher,
.device-switcher {
    display: flex;
    gap: 2px;
    background: var(--bg-secondary);
    padding: 2px;
    border-radius: var(--radius-md);
}

.view-btn,
.device-btn {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    background: transparent;
}

.view-btn:hover,
.device-btn:hover {
    color: var(--primary-color);
    background: var(--bg-primary);
}

.view-btn.active,
.device-btn.active {
    color: var(--primary-color);
    background: var(--bg-primary);
    box-shadow: var(--shadow-sm);
}

/* 预览内容区 */
.preview-content {
    flex: 1;
    display: flex;
    overflow: hidden;
    position: relative;
}

.preview-container,
.code-container {
    flex: 1;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    padding: 40px 20px;
    min-height: 0;
}

/* 手机外框样式 */
.phone-frame {
    width: 375px;
    min-width: 375px;
    height: 667px;
    min-height: 667px;
    max-height: 667px;
    background: #1a1a1a;
    border-radius: 40px;
    padding: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 
                0 0 0 1px rgba(0, 0, 0, 0.1);
    position: relative;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

/* 手机顶部刘海 */
.phone-frame::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 150px;
    height: 24px;
    background: #1a1a1a;
    border-radius: 0 0 20px 20px;
    z-index: 10;
}

/* 手机屏幕 */
.phone-screen {
    flex: 1;
    background: white;
    border-radius: 32px;
    overflow: hidden;
    position: relative;
}

/* 手机底部指示条 */
.phone-frame::after {
    content: '';
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

.preview-iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: white;
}

/* 空预览状态 */
.preview-container .empty-preview {
    width: 375px;
    min-width: 375px;
    height: 667px;
    min-height: 667px;
    max-height: 667px;
    background: #1a1a1a;
    border-radius: 40px;
    padding: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-shrink: 0;
}

.preview-container .empty-preview::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 150px;
    height: 24px;
    background: #1a1a1a;
    border-radius: 0 0 20px 20px;
    z-index: 10;
}

.preview-container .empty-preview::after {
    content: '';
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

.preview-container .empty-preview .empty-content {
    background: white;
    border-radius: 32px;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.empty-icon {
    font-size: 48px;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.empty-content h3 {
    font-size: 20px;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.empty-content p {
    font-size: 14px;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.6;
}

.preview-iframe.device-tablet {
    width: 768px;
    height: 1024px;
    max-width: 100%;
    max-height: 100%;
}

.preview-iframe.device-mobile {
    width: 375px;
    height: 667px;
    max-width: 100%;
    max-height: 100%;
}

/* 空状态 */
.empty-preview {
    text-align: center;
    padding: var(--spacing-xl);
}

.empty-icon {
    width: 120px;
    height: 120px;
    margin: 0 auto var(--spacing-lg);
    border-radius: 50%;
    background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-hover));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: var(--text-placeholder);
}

.empty-preview h3 {
    font-size: var(--font-size-xl);
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
}

.empty-preview p {
    color: var(--text-tertiary);
}

/* 代码显示区 */
.code-tabs {
    display: flex;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    background: #282c34;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.code-tab {
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    color: #abb2bf;
    background: transparent;
    font-size: var(--font-size-sm);
}

.code-tab:hover {
    background: rgba(255, 255, 255, 0.05);
}

.code-tab.active {
    background: rgba(82, 114, 235, 0.2);
    color: #61afef;
}

.code-editor {
    flex: 1;
    overflow: auto;
    background: #282c34;
    position: relative;
}

.code-editor pre {
    margin: 0;
    padding: var(--spacing-lg);
    overflow: auto;
}

.code-editor code {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: var(--font-size-sm);
    color: #abb2bf;
    line-height: 1.6;
}

.btn-copy {
    position: absolute;
    top: var(--spacing-md);
    right: var(--spacing-md);
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.btn-copy:hover {
    background: rgba(82, 114, 235, 0.8);
}

/* 预览底部信息 */
.preview-footer {
    height: 40px;
    padding: 0 var(--spacing-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid var(--border-light);
    background: var(--bg-primary);
}

.generation-info {
    display: flex;
    gap: var(--spacing-lg);
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.info-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

/* ==================== 设置模态框 ==================== */
.settings-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 500px;
    max-width: 90%;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: translate(-50%, -48%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.modal-header {
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: var(--font-size-lg);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.btn-close {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.btn-close:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.modal-body {
    padding: var(--spacing-lg);
}

.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    margin-bottom: var(--spacing-sm);
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input[type="text"],
.form-group input[type="number"] {
    width: 100%;
    padding: var(--spacing-md);
    border: 1px solid var(--border-normal);
    border-radius: var(--radius-md);
    font-size: var(--font-size-md);
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.form-group input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(82, 114, 235, 0.1);
}

.form-group small {
    display: block;
    margin-top: var(--spacing-xs);
    font-size: var(--font-size-xs);
    color: var(--text-tertiary);
}

.form-group input[type="checkbox"] {
    margin-right: var(--spacing-sm);
}

.modal-footer {
    padding: var(--spacing-lg);
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-md);
}

.modal-footer button {
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: var(--radius-md);
    font-size: var(--font-size-md);
    font-weight: 500;
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 1200px) {
    .chat-panel {
        width: 50%;
    }
}

@media (max-width: 768px) {
    .app-header {
        padding: 0 var(--spacing-md);
    }
    
    .page-title {
        font-size: var(--font-size-lg);
    }
    
    .back-btn span {
        display: none;
    }
    
    .main-content {
        flex-direction: column;
    }
    
    .chat-panel,
    .preview-panel {
        width: 100% !important;
    }
    
    .resizer {
        display: none;
    }
}

/* ==================== 滚动条样式 ==================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-dark);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

/* ==================== 打印样式 ==================== */
@media print {
    .app-header,
    .chat-input-container,
    .panel-header,
    .preview-footer {
        display: none;
    }
}
